<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
    <script type="text/javascript" src="./lib/js/evm.js"></script>
    <script type="text/javascript" src="./lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="./lib/js/key.js"></script>
    <script src="./lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/public.js" type="text/javascript" charset="utf-8"></script>
</head>


<body>
    <marquee behavior="" direction="">热烈庆祝周市新时代文明实践线上平台成立！</marquee>
    <div class="index-bg" id="indexMain">
        <div class="model"></div>
        <div class="model"><img src="images/index_button1.png"></div>
        <div class="model"><img src="images/index_button2.png"></div>

        <div class="model"><img src="images/index_button13.png"></div>

        <div class="model"><img src="images/index_button3.png"></div>
        <div class="model"><img src="images/index_button4.png"></div>

        <div class="model"><img src="images/index_button12.png"></div>

        <div class="model"><img src="images/index_button6.png"></div>
        <div class="model"><img src="images/practice_button10.png"></div>
        <div class="model"><img src="images/index_button7.png"></div>
        <div class="model"><img src="images/index_button9.png"></div>
        <div class="model"><img src="images/index_button10.png"></div>
        <div class="model"><img src="images/index_button14.png"></div>
        <!-- <div class="model"><img src="images/index_button11.png"></div> -->

    </div>
</body>
<script src="js/video.js"></script>
<script>
    var mp;
    setTimeout(function () {
        try {
            console.log(mediaStr, '222222222222')
            var mediaStr = "http://10.2.11.145:8080/vod/media/video/279.mp4";
            var videoSize = [78, 139, 562, 317];
            mp = runVideo(mediaStr, videoSize);

        } catch (e) {

        }
    }, 500);
    var video_number;
    var video_time;
    var loop = setInterval(function () {
        video_number = mp.getCurrentPlayTime();
        video_time = mp.getMediaDuration();

        if (video_number > video_time - 3) {
            mp.playByTime(0, 0, 1);
        }
    }, 2000);
    //原先视频播放代码 
    /*
        setTimeout(function () {
            try {
                var mediaStr = "http://10.2.11.145:8080/vod/media/video/81.mp4";
                //var mediaStr = "http://192.168.1.100/lovefrom.mp4";
                var videoSize = [80, 142, 560, 307]; //控制位置和宽高的方法 left top widht height
                mp = runVideo(mediaStr, videoSize);
            } catch (e) {

            }
        }, 1000);


        var video_number = 0;
        var video_time;
        var dtime;

        setTimeout(function () {
            var loop = setInterval(function () {
                video_number += 2;
               // video_time = mp.getMediaDuration(); //获取视频总秒数的方法
                // setTimeout(function () {
                //     TV.PromptMsg(video_time)
                // }, 8000)
                console.log(video_time);
                if (video_number > video_time - 2) {
                    console.log(video_time);
                    console.log(video_number)
                    // TV.PromptMsg(video_number)
                    video_number = 0;
                    // TV.PromptMsg(video_number)
                    // TV.PromptMsg(video_time)
                    mp.playFromStart();
                }
            }, 2000);
        }, 2000)
    */














    var modelIndex = {
        disHeader: true,
        isVideo: true,
        isIndex: true,
        index: 0, //初始位置
        listName: 'model', //模块名称
        containerId: 'indexMain' //包含模块的标签id
    }

    var data = [{
            name: '视频地址',
            url: "./pages/play-shouye.html"
        },
        {
            name: '学习强国',
            url: './pages/multiLineList.html?id=258'
        },
        {
            name: '志愿集结号',
            url: './pages/volunteer.html'
        },
        {
            name: '文明超市',
            url: './pages/shop.html'
        },
        {
            name: '社会治理',
            // url: './pages/infoList.html?id=1059'
            url: './pages/A-shehui.html'

        },

        {
            name: '文明随手拍',
            url: './pages/multiLineList.html?id=1006'
        },
        {
            name: '创业就业',
            // url: './pages/infoList.html?id=1060'
            url: './pages/A-chuangye.html'
        },
        {
            name: '理论大讲堂',
            url: './pages/forum.html'
        },
        {
            name: '教育实践',
            url: './pages/A-jiaoyu.html'
        },
        {
            name: '多彩文化',
            url: './pages/A-wenhua.html'
        },
        {
            name: '科技科普',
            url: './pages/A-keji.html'
        },
        {
            name: '健康体育',
            url: './pages/A-tiyu.html'
        },
        {
            name: '文明创建',
            url: './pages/A-WenMinCreat.html'
        }
    ]

    function direOpt(index, directive) {
        if (directive == "up") { //上
            if (index == 10) {
                index = 6
            } else if (index == 11) {
                index = 12;
            }
            else if (index == 9) {
                index = 4;
            }
            else if (index ==6) {
                index = 2;
            } 
            else if (index ==12) {
                index = 3;
            } 
            else if (index ==10) {
                index = 6;
            }
             else if (index >= 0 && index <= 3) {
                index = -1;
            } else if (index == 4 || index == 5 ) {
                index -= 3;
            } else if (index >= 7 && index <= 8) {
                index = 0;
            } 
            
        } else if (directive == "down") { //下
            console.log("down")
            if (index == 0) {
                index = 7;
            } else if (index == 2) {
                index = 6
            } 
            else if (index == 6) {
                index = 10
            } 
            else if (index == 3) {
                index = 12
            } 
            else if (index == 12) {
                index = 11
            } 
            else if (index == 1 || index == 2 || index == 3) {
                index += 3;
            } else if (index >= 4 && index <= 6) {
                index += 5;
            } else if (index == -1) {
                index += 2;
            }
        } else if (directive == "backwards") { //左
            if (index == 6) {
                index = 4
            }
            else if(index==7){
                index=12
            }
            else if(index==12){
                index=6
            }
             else if (index == 4 || index == 1) {
                index = 0
            } else if (index >= 1) {
                index--;
            }

        } else if (directive == 'forwards') { //右
            console.log('rightright')
            if (index == 4) {
                index = 6
            }else if (index ==6) {
                index=12;
            }
            else if (index ==12) {
                index=7;
            }
             else if (index < 11) {
                index++;
            }
        }
        //console.log(index)
        return index;
    }

    function direEnter(index) {
        // TV.PromptMsg(getBrowser())
        // mp.stop();
        if (data[index].url) {
            window.location.href = data[index].url
        }
    }
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>